package com.amar.dtadmin.apidoc.fegin;

import com.amar.dtadmin.apidoc.model.ApiDocCreateReq;
import com.amar.dtadmin.apidoc.model.ApiDocInfoReq;
import com.amar.dtadmin.apidoc.model.ApiDocInfoResp;
import com.amar.dtadmin.apidoc.model.ApiDocUpdateReq;
import com.amar.dtadmin.apidoc.model.DtAdminLoginReq;
import com.amar.dtadmin.apidoc.model.DtAdminLoginResp;
import com.amar.dtadmin.apidoc.model.DtAdminUserInfoResp;
import com.amar.dtadmin.apidoc.model.Response;
import feign.Feign;
import feign.Headers;
import feign.Param;
import feign.RequestLine;
import feign.jackson.JacksonDecoder;
import feign.jackson.JacksonEncoder;


/**
 * @author xiaoshiqiang
 * @since 2025/2/8
 */
@Headers("Content-Type: application/json;charset=UTF-8")
public interface DtAdminApi {
    static DtAdminApi getInstance() {
        return Feign.builder().encoder(new JacksonEncoder()).decoder(new JacksonDecoder()).target(DtAdminApi.class, "https://cloud.amardata.com/dt");
    }

    @RequestLine("POST /aoas/login?LoginId={loginId}&Password=jkk&code=amar&phoneNo=1")
    DtAdminLoginResp login(@Param String loginId, DtAdminLoginReq loginParam);

    @RequestLine("POST /asset/home/userInfo")
    @Headers({"token: {token}"})
    Response<DtAdminUserInfoResp> userInfo(@Param("token") String token);

    @RequestLine("PUT /asset/api/interface/add")
    @Headers({"token: {token}"})
    Response<Void> create(@Param("token") String token, ApiDocCreateReq createReq);

    @RequestLine("PUT /asset/api/interface/modify")
    @Headers({"token: {token}"})
    Response<Void> update(@Param("token") String token, ApiDocUpdateReq updateReq);


//    @RequestLine("POST /asset/api/interface/list")
//    @Headers({"token: {token}"})
//    Response<InterfaceListResponse> list(@Param("token") String token, InterfaceListRequest var1);

    @RequestLine("POST /asset/api/interface/detail")
    @Headers({"token: {token}"})
    Response<ApiDocInfoResp> detail(@Param("token") String token, ApiDocInfoReq infoReq);

//    @RequestLine("POST /asset/api/common/getlock")
//    @Headers({"token: {token}"})
//    Response<InterfaceLockResponse> lock(@Param("token") String token, InterfaceLockRequest var1);

//    @RequestLine("POST /asset/api/common/unlock")
//    @Headers({"token: {token}"})
//    Response<Void> unlock(@Param("token") String token, InterfaceUnlockRequest var1);
}
